package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {

    @Select("select * from user where openid = #{openId}")
    User getByOpenId(String openId);

    void insert(User user);
@Select("select * from user where id = #{userId}")//根据id查询用户
    User getById(Long userId);

    /**
     * 根据条件统计用户数量
     * @param map
     * @return
     */
  Integer  countByMap(Map map);

}
